<template>
    <a-card :bordered="false">
        <!-- <div class="table-operator">
            <a-button shape="round" size="small" type="primary" icon="plus" @click="handleEdit({},'userInvoiceForm','新增')">添加</a-button>
        </div> -->

        <LTable
        ref="userInvoiceList"
        size="middle"
        rowKey="keyId"
        :formAttributes="formAttributes"
        :columns="columns"
        :initOrder="[{'field': 'createTime','val': 'desc'}]"
        axiosUrl="/KhyUserInvoiceController/page"
        :showPagination="true"
        :showQueryForm="true"
      >

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record,'userInvoiceForm',record.stationName)">详情</a>
        </span>
        
    </LTable>
    <userInvoiceForm ref="userInvoiceForm" @close="refresh('userInvoiceList')" @ok="refresh('userInvoiceList')"></userInvoiceForm> 
    </a-card>
</template>

<script>
import LTable from '@/components/lt/LTable'
import request from '@/utils/request'
import userInvoiceForm from './userInvoiceForm'
import {SysMixin} from '@/mixins/SysMixin'
import defaultSettings from '@/config/defaultSettings'

export default {
    name:'userInvoiceList',
    components:{LTable,userInvoiceForm},
    mixins:[SysMixin],
    data(){
        return{
            initDictCodes:defaultSettings.数据字典.发票开具状态,
            defaultSettings,
            formAttributes:[
                
                {field:'packageNo',label:'快递单号',component:'input',condition:'like'},
            ],
         
            columns:[
                {
                    title: '序号',
                    dataIndex: '',
                    key:'rowIndex',
                    width:60,
                    align:"center",
                    customRender:function (t,r,index) {
                      return parseInt(index)+1;
                    }
                },
                {
                    title: '快递单号',
                    dataIndex: 'packageNo'
                },
                {
                    title: '申请时间',
                    dataIndex: 'createTime'
                },
                {
                    title: '发票抬头',
                    dataIndex: 'invoiceTitle'
                },
                {
                    title: '纳税人识别号',
                    dataIndex: 'invoiceNo'
                },
                 {
                    title: '手机号',
                    dataIndex: 'userNo'
                },
                 {
                    title: '邮箱',
                    dataIndex: 'userEmail'
                },
                {
                    title: '开票状态',
                    dataIndex: 'invoiceStatus',
                    customRender:(text)=>{
                        if(!text){
                            return ''
                        }else{
                            return this.dictText(defaultSettings.数据字典.发票开具状态,text)
                        }
                    }
                },
                
                
                {
                    title: '操作',
                    dataIndex: 'action',
                    width: '120px',
                    scopedSlots: { customRender: 'action' }
                }
            ],
            
        }
    },
    created(){
       
    },
    methods:{
       
    }
}
</script>